<?php

namespace app\middleware;

use think\Cache;
use think\facade\Session;

class HomeAuth
{
    public function handle($request, \Closure $next)
    {

        // 记住当前地址并重定向




        if (\session('member_id') < 1 || is_null(session('member_id'))) {


            $url=url('Login/login');

            return Redirect("$url")->with('message', '请先登录');
        }


        return $next($request);
    }
}